package com.cq.jackmar.rxdemo.demo;

import android.os.Bundle;
import android.widget.TextView;

import com.cq.jackmar.rxdemo.R;
import com.cq.jackmar.rxdemo.base.BaseActivity;
import com.cq.jackmar.rxdemo.http.base.BaseResult;
import com.cq.jackmar.rxdemo.http.httphelper.HttpHelperUser;
import com.cq.jackmar.rxdemo.http.subscriber.IOnNextListener;
import com.cq.jackmar.rxdemo.http.subscriber.ProgressSubscriber;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by JackMar on 2017/3/10.
 * 邮箱：1261404794@qq.com
 */

public class ProgressActivity extends BaseActivity {
    @Bind(R.id.tv_content)
    TextView mTvContent;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_progress;
    }

    @Override
    protected void initView() {
        HttpHelperUser.getInstance().test(new ProgressSubscriber<BaseResult>(context, new IOnNextListener<BaseResult>() {
            @Override
            public void onNext(BaseResult baseResult) {
                mTvContent.setText(baseResult.toString());
            }
        }));
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
